package com.junzhiit.nengji.shop.model.enums;

import com.bainaeco.framework.exception.InvalidArgumentException;

public enum ShopDeliveryVehicle {

	BICYCLE(0, "步行配送"), ELECTRIC_VEHICLE(1, "骑行配送"), TRANSIT(2, "搭乘公交车配送"), AUTOMOBILE(3, "驾车配送"), OTHER(4, "其他配送方式");

	private String text;
	private Integer value;

	private ShopDeliveryVehicle(Integer value, String text) {
		this.value = value;
		this.text = text;
	}

	public Integer toIntValue() {
		return this.value;
	}

	public String toStringText() {
		return this.text;
	}

	public static ShopDeliveryVehicle toStatus(Integer value) {
		if (BICYCLE.value == value) {
			return BICYCLE;
		} else if (ELECTRIC_VEHICLE.value == value) {
			return ELECTRIC_VEHICLE;
		} else if (TRANSIT.value == value) {
			return TRANSIT;
		} else if (AUTOMOBILE.value == value) {
			return AUTOMOBILE;
		} else if (OTHER.value == value) {
			return OTHER;
		} else {
			throw new InvalidArgumentException("Unknown OrderStatus[" + value + "].");
		}
	}
}
